﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Zeus.Classes;
using Zeus.Web;
using MenuControl;
using System.IO;
using Zeus.Web.Classes;
using System.Xml.Linq;
using Zeus;
using Zeus.UserControls;

namespace Zeus.UserControls
{
    public partial class menu_view_UserControl : UserControl
    {
        int counter_ToolBox = 0;
        int counter_SoultionExplorer = 0;
        int counter_TeamExplorer = 0;
        int counter_ServerExplorer = 0;
        int counter_Proparties = 0;
        int counter_Debug = 0;

        public menu_view_UserControl()
        {
            InitializeComponent();
        }

        public void AddTolBox(int i, string name)
        {
            for (int j = 1; j <= i; j++)
            {
                ListBox listBox_1 = new ListBox();
                listBox_1.Width = 180;
                listBox_1.Height = 500;
                listBox_1.VerticalAlignment = VerticalAlignment.Center;
                listBox_1.Margin = new Thickness(20, 20, 0, 0);
                listBox_1.BorderThickness = new Thickness(10, 10, 10, 10);
                TextBlock textBlock = new TextBlock();
                textBlock.Text = name;
                textBlock.TextAlignment = TextAlignment.Center;
                textBlock.FontSize = 24;
                SolidColorBrush s = new SolidColorBrush();
                s.Color = Colors.Red;
                textBlock.Foreground = s;
                listBox_1.Items.Add(textBlock.Text);
                stk_pnl.Children.Add(listBox_1);

            }
        }
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            if (counter_TeamExplorer == 0)
            {
                AddTolBox(Convert.ToInt32(Resource_file_1.count), Resource_file_1.textBlock_team_explorer);
                counter_TeamExplorer++;

            }
            else
            { MessageBox.Show("There are Team Explorer  already opened"); }

        }

        private void MenuItem_Click_1(object sender, RoutedEventArgs e)
        {
            if (counter_ToolBox == 0)
            {
                AddTolBox(Convert.ToInt32(Resource_file_1.count), Resource_file_1.textBlock_tool_Box);
                counter_ToolBox++;
            }
            else { MessageBox.Show("there are Tool Box already opened"); }
        }

        private void MenuItem_Click_2(object sender, RoutedEventArgs e)
        {
            if (counter_SoultionExplorer == 0)
            {
                AddTolBox(Convert.ToInt32(Resource_file_1.count), Resource_file_1.textblock_soultion);
                counter_SoultionExplorer++;
            }
            else { MessageBox.Show("there ara Solution Explorer already opened"); }
        }

        private void MenuItem_Click_3(object sender, RoutedEventArgs e)
        {
            if (counter_ServerExplorer == 0)
            {
                AddTolBox(Convert.ToInt32(Resource_file_1.count), Resource_file_1.textblock_server_explorer);
                counter_ServerExplorer++;
            }
            else { MessageBox.Show("there are server explorer already opened"); }
        }

        private void MenuItem_Click_4(object sender, RoutedEventArgs e)
        {
            if (counter_Debug == 0)
            {
                AddTolBox(Convert.ToInt32(Resource_file_1.count), Resource_file_1.textBlock_Debug);
                counter_Debug++;
            }
            else { MessageBox.Show("there are Debug menu opened"); }
        }

        private void MenuItem_Click_5(object sender, RoutedEventArgs e)
        {
            if (counter_Proparties == 0)
            {
                AddTolBox(Convert.ToInt32(Resource_file_1.count), Resource_file_1.textBlock_proparties);
                counter_Proparties++;
            }
            else { MessageBox.Show("there are prparties menu already opened"); }
        }

      
    }
}
